#pragma once
#include <techview.h>

namespace zqdb {

	static const double _E = (2.7182818285);
	static const double _e = _E;
	static const double _PI = (3.1415926536);
	static const double _pi = _PI;

	double Log(double dvalue);
	double Float2Scale(int ctype, double dvalue, double dmin, double dmax);
	int Float2YPoint(int ctype, double dvalue, double dbase, double yscale, int ybase);
	double YPoint2Float(int ctype, int yvalue, double dbase, double yscale, int ybase);

	//////////////////////////////////////////////////////////////////////////
	///Draw

	wxPenStyle LineToPenStyle(CALC_LINE_TYPE type);

	void DrawLine(wxDC& dc, const wxPoint& x, const wxPoint& y);
	void DrawLine(wxDC& dc, const wxPoint& x, const wxPoint& y
		, const wxPen& pen);
	void DrawPolyLine(wxDC& dc, const wxPoint* points, const size_t count);
	void DrawPolyLine(wxDC& dc, const wxPoint* points, const size_t count
		, const wxPen& pen);
	void DrawStick(wxDC& dc, const Rect& rc, CALC_STICK_TYPE type);
	void DrawStick(wxDC& dc, const Rect& rc, CALC_STICK_TYPE type
		, const wxPen& pen, const wxBrush& brush);
	void DrawHistogram(wxDC& dc, const wxPoint* points, const size_t count
		, CALC_HISTOGRAM_TYPE type);
	void DrawHistogram(wxDC& dc, const wxPoint* points, const size_t count
		, CALC_HISTOGRAM_TYPE type, const wxPen& pen, const wxBrush& brush);
	void DrawKline(wxDC& dc, const wxPoint& open, const wxPoint& high
		, const wxPoint& low, const wxPoint& close
		, CALC_KLINE_TYPE type);
	void DrawKline(wxDC& dc, const wxPoint& open, const wxPoint& high
		, const wxPoint& low, const wxPoint& close
		, CALC_KLINE_TYPE type, const wxPen& pen, const wxBrush& brush);

}
